#ifndef WORLD_H
#define WORLD_H


#include "include.h"
#include "gameregion.h"
#include "player.h"


class Player;

class World : public QObject
{
    Q_OBJECT
public:
    explicit World(QObject *parent = 0);
    int getItemId(QString &str);
    int getCommandId(QString &str);
    int getCreatureId(QString &str);
public slots:
    void getCommandFromWindow(QString str);
private:
    Player *_player;
    QVector< QVector<GameRegion*> > _map;
    
    QMap<QString,int> _global_commands;
    QMap<QString,int> _global_items;
    QMap<QString,int> _global_creatures;

    void initMap(int size);
    bool openFileWithItems(void);
    bool openFileWithCommands(void);
    bool openFileWithCreatures(void);
    bool openFileWithRegions(void);
    bool loadRegion(QStringList &strings);
    bool addRegion(GameRegion *reg);
};

#endif // WORLD_H
